package com.trippin.Utils;

import java.lang.reflect.Type;
import java.text.SimpleDateFormat;
import java.util.Date;

import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;

public class TrippinDateJsonSerializer implements JsonSerializer<Date> {

	@Override
	public JsonElement serialize(Date date, Type type,
			JsonSerializationContext context) {
		
		SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm");
		return new JsonPrimitive(sdf.format(date));
	}

}
